package com.study.this_bro_constructor;

public class Student {
    private String name;
    private int age;
    private String home;

    public Student() {
    }
    //this(...)和super(...)不能同时出现，且必须放在构造器的第一行
    public Student(String name, int age) {
        //在构造器中调用本类中的兄弟构造器
      this(name,age,"无家可归！");
    }

    public Student(String name, int age, String home) {
        this.age = age;
        this.name = name;
        this.home = home;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getHome() {
        return home;
    }

    public void setHome(String home) {
        this.home = home;
    }
}
